package com.ylfstu.collection_;

import java.util.ArrayList;
import java.util.List;

public class CollectionMethod {
    @SuppressWarnings({"all"})
    public static void main(String[] args) {
        List list = new ArrayList();
        list.add("new");
        list.add(10);// list.add(new Integer(10));
        list.add(true);
        System.out.println(list);

//        list.remove("new");
        list.remove(2);
        System.out.println(list);

        System.out.println(list.contains("new"));

        System.out.println(list.size());

        System.out.println(list.isEmpty());

        list.clear();
        System.out.println(list);

        List list2= new ArrayList();
        list2.add("红楼梦");
        list2.add("三国演义");
        list2.add("西游记");
        list.addAll(list2);
        System.out.println(list);

        System.out.println(list.containsAll(list2));

        list.add("水浒传");
        list.removeAll(list2);
        System.out.println(list);
    }
}












